package com.tp7567.service;

import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
import com.tp7567.domain.Patient;
import com.tp7567.domain.Sintoma;

/**
 * 
 * @author Maxi Rosson
 * @param <T>
 */
@SuppressWarnings("serial")
public abstract class Question<T extends Sintoma> implements Serializable {
	
	private String questionName;
	private String description;
	private List<T> sintomas;
	
	public Question(String questionName, String description, T[] sintomas) {
		this.questionName = questionName;
		this.description = description;
		this.sintomas = Lists.newArrayList(sintomas);
	}
	
	public abstract void executeAnswer(Patient patient, Sintoma answer);
	
	public abstract Sintoma getSelectedAnswer(Patient patient);
	
	public String getQuestionName() {
		return questionName;
	}
	
	public List<T> getAvailableAnswers() {
		return sintomas;
	}
	
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
}
